<template>
	<view class="trade-buy">
		<view class="trade-buy-list">
			<!-- <scroll-view class="scroll-view" :scroll-y="true" @scroll="scroll" scroll-left="120"> -->
                <view class="tbl tbl-item van-hairline--top-bottom"
                	v-for="(key, index) in buys" :key="index">
                	<view class="tbl-item-info">
                		<view class="tbl-item-info-id">
                			<view class="tbl-item-info-oid">
                				<text>td-20190230</text>
								<text class="time">2019-02-30 8:30</text>
                			</view>
                		</view>
                		<view class="tbl-item-info-sum">
                			<text>100 积分</text> 
                		</view>
                	</view>
                	<view class="tbl-item-btn">
						<view class="type" :class="{'type2': index > 2}">
						    {{index > 2 ? '挂单中' : '已卖出'}}
						</view>
                	</view>
                </view>
            <!-- </scroll-view> -->
		</view>
	</view>
</template>
<script>
	export default {
		props: {
			active: {
				type: Number,
			}
		},
		data() {
			return {
				buys: []
			}
		},
		onReachBottom () {
			this.gitList()
		},
		watch: {
		  active(val) {
			this.gitList()
		  }
		},
		methods: {
			gitList () {
				if (this.active !== 2) return false
				for(let i = 0; i < 10; i++) {
					let sum = Math.random()*5
					this.buys.push(sum)
				}
			}
		},
		components: {
		}
	}
</script>
<style scoped lang="scss">
	@import '../../../common/integral-trade.scss'
</style>
